Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adding escalated status check #46

Merged
merged 8 commits into from
Jul 18, 2024
Merged

fix: adding escalated status check #46

merged 8 commits into from
Jul 18, 2024

Conversation

ashitakah
Copy link
Contributor

🤖 Linear

Closes GRT-7

Copy link

linear bot commented Jul 8, 2024

GRT-7 TOB-WOND-8

if (ORACLE.disputeStatus(_disputeId) != IOracle.DisputeStatus.None) {
if (
ORACLE.disputeStatus(_disputeId) != IOracle.DisputeStatus.None
&& ORACLE.disputeStatus(_disputeId) != IOracle.DisputeStatus.Escalated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The finding only says to check against IOracle.DisputeStatus.Escalated. Does it also need to keep None? What is that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep we should left the None also, is the other case which the dispute can be voted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xShaito @0xJabberwock the None status means the dispute has not started yet.

There are 2 somewhat realistic scenarios that could lead to a dispute having the None in this function:

  1. The ID is incorrect, in which case ORACLE.createdAt(_disputeId) == 0 effectively duplicates this check.
  2. The dispute was created in a messed up module that somehow called the updateDisputeStatus function of the oracle and set an invalid status.

The second point is a bit concerning but the off-chain logic should catch that, so I would remove the None check.

0xShaito
0xShaito previously approved these changes Jul 16, 2024
@0xShaito 0xShaito merged commit 1dffdc6 into dev Jul 18, 2024
3 checks passed
@0xShaito 0xShaito deleted the fix/dispute-lock branch July 18, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants